<template>
  <div class="step-box">
    <el-form ref="form" :model="form" disabled label-width="150px">
      <div class="form-box">
        <p class="sub-title">营业执照信息</p>
        <div class="form-item">
          <div class="form-flex-item">
            <el-form-item label="主体类型：" prop="mainBodyType">
              <el-select v-model="form.mainBodyType" clearable>
                <el-option
                  v-for="item in principalType"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                />
              </el-select>
            </el-form-item>
          </div>
          <div class="form-flex-item">
            <el-form-item label="资质图片：" prop="aptitudeImage">
              <UploadFile :file-list="form.aptitudeImage" disabled />
            </el-form-item>
          </div>
          <div class="form-flex-item">
            <el-form-item label="社会统一信用代码：" prop="socialCreditCode">
              <el-input v-model="form.socialCreditCode" maxlength="18" placeholder="请输入" clearable />
            </el-form-item>
          </div>
          <div class="form-flex-item">
            <el-form-item label="名称：" prop="infoName">
              <el-input v-model="form.infoName" placeholder="请输入" clearable />
            </el-form-item>
          </div>
        </div>
      </div>
      <div class="form-box">
        <p class="sub-title">法人身份信息信息</p>
        <div class="form-item">
          <div class="form-flex-item">
            <el-form-item label="法人身份信息：" prop="belongingPlace">
              <el-radio-group v-model="form.belongingPlace">
                <el-radio v-for="item in identityType" :key="item.value" :label="item.value">{{ item.label }}</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div class="form-flex-item">
            <el-form-item prop="idPhoto">
              <UploadFile :file-list="form.idPhoto" disabled />
            </el-form-item>
          </div>
          <div class="form-flex-item">
            <el-form-item label="身份证号：" prop="idCardNumber">
              <el-input v-model="form.idCardNumber" placeholder="请输入" clearable />
            </el-form-item>
          </div>
          <div class="form-flex-item">
            <el-form-item label="姓名：" prop="aptitudeName">
              <el-input v-model="form.aptitudeName" placeholder="请输入" clearable />
            </el-form-item>
          </div>
          <div class="form-flex-item">
            <el-form-item label="联系方式：" prop="phone">
              <el-input v-model.trim="form.phone" placeholder="请输入" maxlength="11" clearable />
            </el-form-item>
          </div>
        </div>
      </div>
    </el-form>
  </div>
</template>

<script>

import { PRINCIPAL_TYPE, IDENTITY_TYPE } from '@/utils/enum'
import UploadFile from '@/components/UploadFile/index.vue'

export default {
  name: 'Step2',
  components: {
    UploadFile
  },
  props: {
    formDetail: {
      type: Object,
      default: () => ({})
    }
  },

  data() {
    return {
      principalType: PRINCIPAL_TYPE,
      identityType: IDENTITY_TYPE,
      form: {}
    }
  },

  watch: {
    formDetail(value) {
      this.form = value
    }
  },

  methods: {

  }
}
</script>
<style lang="scss" scoped>
@import './step.scss';
</style>
